package com.hotdog.controller;

import com.hotdog.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 接收支付请求入库
 * @author 郭鲁政
 */
@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private PayService payService;

    @GetMapping("/payinfo/{username}/{orderid}")
    public void getPayInfo(@PathVariable String username, @PathVariable String orderid) {
        payService.insertPayUser(username, orderid);
    }
    @GetMapping("/returnpayinfo/{money}/{orderid}")
    public void returnInfo(@PathVariable(name = "money")String money,@PathVariable(name = "orderid")String orderid){
        payService.updateInfo(money,orderid);
    }


}
